package com.tqfframe.test.algorihm;

import org.apache.commons.codec.binary.Base64;

/**
 * @Author: 唐祺峰
 * @Date: 2020/10/22 0022 10:20
 * @Version 1.0
 */
public class TranscodeUtil {
    //byte[]转base64
    public static String byteArrayToBase64Str(byte[] b) {
        return Base64.encodeBase64String(b);
    }

    //base64字符串转byte[]
    public static byte[] base64StrToByteArray(String base64Str){
        return Base64.decodeBase64(base64Str);
    }
}
